﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Homework01
{
    public partial class Form1 : Form
    {

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.txt_yhm.Text) || string.IsNullOrWhiteSpace(this.txt_mm.Text)) 
            {
                MessageBox.Show("不能为空");
                return;
            }
            if ((this.txt_yhm.Text == "zhangsan" && this.txt_mm.Text == "0000" && this.cobx_cy.Text == "管理员") || (this.txt_yhm.Text == "lisi" && this.txt_mm.Text == "1111" && this.cobx_cy.Text == "普通员工"))
            {
                MessageBox.Show("登录成功");
                Form2 form2 = new Form2();
                this.Hide();               
                form2.ShowDialog();
                this.Dispose();
            }
            else
            {
                MessageBox.Show("登录失败");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            System.Environment.Exit(0);
        }
    }
}
